package com.shop.common;

import java.util.regex.Pattern;

/**
 * 系统常量类
 */
public class Constants {
    /**
     * Session相关常量
     */
    public static class Session {
        /** 用户Session Key */
        public static final String USER = "user";
        /** 验证码Session Key */
        public static final String REGISTER_PHONE_CODE = "code";
        public static final String USER_LOGIN_TYPE = "loginType";
        /** Session过期时间（秒） */
        public static final int SESSION_TIMEOUT = 18000;
        public static final String MESSAGE = "message";
    }

    public static class Model{
        public static final String USER = "user";
        public static final String MESSAGE = "message";
        public static final String ERROR = "error";
    }
    /**
     * 系统配置相关常量
     */
    public static class Config {
        /** 系统名称 */
        public static final String SYSTEM_NAME = "电商系统";
        /** 版本号 */
        public static final String VERSION = "1.0.0";
        /** 版权信息 */
        public static final String COPYRIGHT = "© 2025 电商系统 版权所有";
    }

    // 正则表达式
    public static class Regex {
        /** 手机号 */
        public static final String PHONE = "^1[3-9]\\d{9}$";
        /** 邮箱 */
        public static final String EMAIL = "^[a-zA-Z0-9._%+-]+@qq\\.com$";
        public static final String PASSWORD_REGEX = "^[A-Z][A-Za-z0-9]{5,9}$";
        public static final String USERNAME_REGEX = "^[^0-9][A-Za-z0-9\\u4E00-\\u9FFF!@#$%^&*()_+\\-=\\[\\]{};':\",./<>?]{5,9}$";
    }
} 